﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<OurSite.WebAdmin.Models.ListingImages>" %>
<%@ Import Namespace="OurSite.Business.Event"%>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Manage Events
</asp:Content>

<asp:Content id="Content3" ContentPlaceHolderID="HeaderContent" runat="server">

</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

  <table>
     <tr><th colspan="2">Decades</th></tr>
    <% foreach (Event e in Model.Decades){ %>
    <tr>
        <td>
            <%= Html.ActionLink(e.Name, "ListingImageEdit", "Event", new { type = "Decades",  name=e.Name})%>
        </td>
        <td><%= !string.IsNullOrEmpty(e.ListingPicture.ImagePath) ? "<img src='" + ConfigurationManager.AppSettings["ImagePrefix"] + "Small" + e.ListingPicture.ImagePath + "' class='thumbnail'/>" : "No image set"%></td>
    </tr>
    <%} %>
    
    <tr><th colspan="2">Regions</th></tr>
      <% foreach (Event e in Model.Regions){ %>
    <tr>
        <td>
            <%= Html.ActionLink(e.Name, "ListingImageEdit", "Event", new { type = "Regions", name = e.Name })%>
        </td>
        <td><%= !string.IsNullOrEmpty(e.ListingPicture.ImagePath) ? "<img src='" + ConfigurationManager.AppSettings["ImagePrefix"] + "Small" + e.ListingPicture.ImagePath + "' class='thumbnail'/>" : "No image set"%></td>
        <% if (e.SubEvents.Count > 0){ %>
            </tr>
            <tr><th colspan="2">States</th></tr>        
        <%} %>
        
        <% foreach (Event sub in e.SubEvents){ %>
            <tr>
                <td>
                    <%= Html.ActionLink(e.Name, "ListingImageEdit", "Event", new { type = "States", name = e.Name })%>
                </td>
                <td><%= !string.IsNullOrEmpty(sub.ListingPicture.ImagePath) ? "<img src='" + ConfigurationManager.AppSettings["ImagePrefix"] + "Small" + sub.ListingPicture.ImagePath + "' class='thumbnail'/>" : "No image set"%></td>        
            </tr>
        <%} %>
    </tr>
    <%} %>
    
    <tr><th colspan="2">People</th></tr>
      <% foreach (Event e in Model.People){ %>
    <tr>
        <td>
            <%= Html.ActionLink(e.Name, "ListingImageEdit", "Event", new { type = "People", name = e.Name })%>
        </td>
        <td><%= !string.IsNullOrEmpty(e.ListingPicture.ImagePath) ? "<img src='" + ConfigurationManager.AppSettings["ImagePrefix"] + "Small" + e.ListingPicture.ImagePath + "' class='thumbnail'/>" : "No image set"%></td>
    </tr>
    <%} %>
    
    <tr><th colspan="2">Event Categories</th></tr>
    <% foreach (Event e in Model.ParentCategories){ %>
    <tr>
        <td>
            <%= Html.ActionLink(e.Name, "ListingImageEdit", "Event", new { type = "Categories", name = e.Id })%>
        </td>
        <td><%= !string.IsNullOrEmpty(e.ListingPicture.ImagePath) ? "<img src='" + ConfigurationManager.AppSettings["ImagePrefix"] + "Small" + e.ListingPicture.ImagePath + "' class='thumbnail'/>" : "No image set"%></td>
    </tr>
    <%} %>
    
 
  </table>

</asp:Content>
